x = [61 138 150];
y = [97  66 154];

mx = [0 0 0];
my = [0 0 0];
s = [0 0 0];
k = [0 0 0];
for i=1:3
    mx(i) = (x(i) + x(mod(i,3)+1))/2;
    my(i) = (y(i) + y(mod(i,3)+1))/2;
    s(i) = -(x(mod(i,3)+1) - x(i))/(y(mod(i,3)+1) - y(i));
    k(i) = my(i) - s(i) * mx(i);
end

xc = (k(2) - k(1)) / (s(1) - s(2))
yc = s(1) * xc + k(1)

d1 = (x(1) - xc)*(x(1) - xc) + (y(1) - yc) * (y(1) - yc)
d2 = (x(2) - xc)*(x(2) - xc) + (y(2) - yc) * (y(2) - yc)
d3 = (x(3) - xc)*(x(3) - xc) + (y(3) - yc) * (y(3) - yc)